package org.codeart.pay.service;

import org.codeart.common.request.OrderRequest;
import org.codeart.common.util.HttpStatus;
import org.codeart.common.util.R;
import org.codeart.pay.remote.ServiceOrderClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AliPayService {
    
    @Autowired
    private ServiceOrderClient serviceOrderClient;
    
    public boolean pay(Long orderId) {
        OrderRequest orderRequest = new OrderRequest();
        orderRequest.setOrderId(orderId);
        R<Void> r = serviceOrderClient.pay(orderRequest);
        return r.getCode() == HttpStatus.HTTP_OK;
    }
    

}
